<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>留言管理</title>

<style type="text/css">
	//分页用到的css
	.pagebar {
		padding: 0.2em 0.5em;
		margin-right: 0.1em;
		margin-bottom: 1.0em;
		border: 1px solid #fff;
		background: #fff;
		text-decoration: none;
		text-align: left;
	}
	
	.pagebar a,.pageList .this-page {
		border: 1px solid #9AAFE5;
		text-decoration: none;
		padding: 0.2em 0.5em;
	}
	
	.pagebar a:visited {
		border: 1px solid #9AAFE5;
		text-decoration: none;
		padding: 0.2em 0.5em;
	}
	
	.pagebar .break {
		padding: 2px 6px 2px 6px;
		border: none;
		background: #fff;
		text-decoration: none;
	}
	
	.pagebar .this-page {
		border: 1px solid #2E6AB1;
		padding: 0.2em 0.5em;
		font-weight: bold;
		background: #2E6AB1;
		color: #fff;
	}
	
	.pagebar a:hover {
		border-color: #2E6AB1;
	}
	
	.pagebar .inactive
	{
	   border: 1px solid #cccccc;
		 color: #ccc;
	   text-decoration: none;
	   padding: 0.2em 0.5em;
	}
</style>

<link rel="stylesheet" type="text/css" href="/wsd/jslib/ext/resources/css/ext-all.css" />
<script type="text/javascript" src="/wsd/jslib/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/wsd/jslib/ext/ext-all-debug.js"></script>
<script type="text/javascript" src="/wsd/jslib/ext/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="/wsd/admin/js/message.js"></script>
</head>

<body>
	<c:if test="${messages == null}">
		<c:redirect url="/admin/message_show.action"/>
	</c:if>
  <div class="pagebar" align="left" >${pageStr}</div>
  <br/>
  <c:forEach items="${messages}" var="message">
  	<table bgcolor="#FFF6DD" width="800">
    	<tr>
        	<td width="32">姓名</td>
            <td width="686">${message.MName}</td>
        </tr>
        <tr>
        	<td>电话</td>
            <td>${message.MMobile }</td>
        </tr>
        <tr>
        	<td>邮箱</td>
            <td>${message.MEmail }</td>
        </tr>
        <tr>
          <td>时间</td>
          <td><fmt:formatDate value="${message.MTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
        </tr>
        <tr>
        	<td valign="top">内容</td>
            <td bgcolor="#F5F4FA">${message.MContent }</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
              <td id="${message.MId}2">
                <a href='javascript:createWindow(${message.MId },${curPage})'>回复</a> 
                <a href='/wsd/admin/message_delete.action?page=${curPage}&amp;message.MId=${message.MId}'>删除</a>
              </td>
        </tr>
        <tr>
        	<td valign="top">回复</td>
            <td id="${message.MId}">
				<div id="${message.MId}">            
	            	<c:forEach items="${message.messages}" var="replay">
	            		<p>${replay.MContent}<br/>
	            			<fmt:formatDate value="${replay.MTime}" pattern="yyyy-MM-dd HH:mm:ss"/><br/>
	            			<a href='/wsd/admin/message_delete.action?page=${curPage}&message.MId=${replay.MId}'>删除</a>
	            		</p>
	            	</c:forEach>
            	</div>
            </td>
        </tr>
    </table>
    <hr />
    <br/>
</c:forEach>
  
	<div class="pagebar" align="left" >${pageStr}</div>
</body>
</html>